package org.al.poc.generator;


public class Client implements Runnable {

	private String host;
	private int port;
	private int nbThreads;
	private ClientPart[] clients;
	
	
	public Client(String host, int port, int nbThreads) {
		this.host = host;
		this.port = port;
		this.nbThreads = nbThreads;
		this.clients = new ClientPart[nbThreads];
	}
	
	
	@Override
	public void run() {

//		logClientRunning();

		ClientPart.mustRun = true;
		
		for (int i = 0 ; i < nbThreads ; ++i) {
			clients[i] = new ClientPart(host, port, i);
			new Thread(clients[i]).start();
		}

	}
	
	
	public void stop() {
//		for (ClientPart client : clients)
//			client.stop();
		ClientPart.mustRun = false;
	}

//	private void logClientRunning() {
//	}
}
